package org.idea.qiyu.live.framework.redis.starter.key;

import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: ImCoresServerProviderCacheKeyBuilder
 * @Description: 心跳包
 * @Author zhangguangyan
 * @Date 2023/08/29/ 20:52:39
 * @Version 1.0
 */
@Configuration
@Conditional(RedisKeyLoadMatch.class)
public class ImCoresServerProviderCacheKeyBuilder extends RedisKeyBuilder{
    private static String IM_ONLINE_ZSET = "imOnlineZset";
    private static String IM_ACK_MAP = "imAckMap";
    public String buildImAckMapKey(Long userId,Integer appId) {
        return super.getPrefix() + IM_ACK_MAP + super.getSplitItem() + appId+ super.getSplitItem() + userId%100;
    }

    public String buildUserLoginToken(Long userId,Integer appId) {
        return super.getPrefix() + IM_ONLINE_ZSET + super.getSplitItem() + appId+ super.getSplitItem() + userId%10000;
    }
}
